﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Pragma" content="no-cache,no-store" />
    <meta http-equiv="Cache-Control" content="no-cache,no-store" />
    <meta http-equiv="Expires" content="0" />
    <title>神州科技-企捷微信办公平台</title>
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/CSS/Base/NewIndex.css" />
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1441353436_7928936.css" />
    <link href="/CSS/Base/hover.css" rel="stylesheet" type="text/css" />


    <style>
        .iconfont {
            font-family: "iconfont";
            font-style: normal;
        }
    </style>
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/Scripts/jquery-migrate-1.1.0.min.js"></script>
    <script type="text/javascript" src="/JqueryPlug/layer2/layer/layer.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>

    <script>
        function addNewTab(url, appcode, title, isactive) {
            var tabli = $('<li title="双击刷新" hrefurl=' + url + ' appcode=' + appcode + '><i class="iconfont icon-jiesuo unlock" style="cursor: pointer;position: absolute;left: 3px;top: -10px;font-size: 12px;color:#3085DB;"></i>' + title + '<i class="iconfont icon-55 deltab" style=" position: absolute;right: 3px;top: -10px;font-size: 16px;color:#3085DB;visibility:hidden;cursor: pointer;"></i></li>');
            tabli.find(".deltab").click(function () {
                if (tabli.find("icon-suo").length > 0) {
                    layer.tips('解锁后才能关闭哦', this, { tips: [1] });
                } else {
                    tabli.remove();
                    $("#Tab" + appcode).remove();
                    if ($(".tabiframe:visible").length === 0) {
                        $(".tab_nav li").last().trigger('click');
                    }
                }
            })
            if (!isactive) {
                $(".tab_nav li").removeClass("active");
                $(".tab_pane").hide();
                tabli.addClass("active");
            }
            tabli.hover(function () {
                $(this).find(".deltab").css({ visibility: 'visible' });
            },
            function () {
                $(this).find(".deltab").css({ visibility: 'hidden' });
            })

            tabli.find(".unlock").click(function (event) {
                event.stopPropagation();
                if ($(this).hasClass("icon-jiesuo")) {
                    $(this).removeClass("icon-jiesuo").addClass("icon-suo");
                    layer.tips('锁定成功', this, { tips: [1] });

                } else {
                    $(this).removeClass("icon-suo").addClass("icon-jiesuo")
                    layer.tips('解锁成功', this, { tips: [1] });

                }
                var codes = "";
                $(".tab_nav").find("icon-suo").each(function () {
                    codes = codes + $(this).parent().attr("appcode") + ",";
                })
                ComFunJS.setCookie('codes', codes)
            })

            $(".tab_nav").append(tabli);
            //总Tab数不能超过5个,如果超过了,则自动删除最早打开的
            if ($(".tab_nav li").length > 7) {
                $(".tab_nav li").eq(1).remove();
                $(".tab_pane").eq(1).remove();
            }
        }
        function SetFrameHeight(framename) {
            layer.load(0, {
                shade: [0.3, 'black'] //0.1透明度的白色背景
            });
            var oFrm = document.getElementById(framename);
            oFrm.onload = oFrm.onreadystatechange = function () {
                if (this.readyState && this.readyState != 'complete') return;
                else {
                    var mainheight = $("body").height() - 111;
                    $("#" + framename).height(mainheight);
                    $(window.frames[framename].document).find(".contentdv").css({ height: mainheight + "px", overflow: "auto" });
                    layer.closeAll();
                }
            }
        }
        function openframe(url, appcode) {
            var nframe = $("#main").clone();
            nframe.attr("id", "frame" + appcode).attr("name", "frame" + appcode).attr("src", url + "?ranparam=" + ComFunJS.getnowdate("yyyy-mm-dd"));
            var newcontent = $('<div id="Tab' + appcode + '" class="tab_pane" style="display:block"></div>').append(nframe);
            $(".tab_content").append(newcontent);
            SetFrameHeight("frame" + appcode);
        }
        $.getJSON('/API/FTAPI.ashx?Action=GETRCTXCOUNTANDCOMPANY', function (resultData) {
            if (resultData.ErrorMsg == "") {
                $(".comName").text(resultData.Result1);
                $(".imgwap .badge").text(resultData.Result == "0" ? "" : resultData.Result);
                $(document).attr("title", resultData.Result1 + "-企捷微信办公平台");//修改title值
            }
        })
        $.getJSON('/API/SZHLAPI.ashx?Action=GETUSERBYUSERNAME', { P1: ComFunJS.getnowuser() }, function (resultData) {
            if (resultData.ErrorMsg == "") {
                if (resultData.Result.zhiwu == '代理商') {
                    $(".xtsz").remove();
                }
            }
        })
    </script>
</head>
<body style="overflow:hidden">
    <div id="header" style="height:100px">
        <div class="topCont wrapper" style="width:85%;">
            <div class="logo">
                <span class="comName"> </span>
            </div>
            <div class="app appexit">
                <div class="appWrap  hvr-float-shadow">
                    <div class="imgwap"><i class="iconfont icon-tuichudenglu"></i></div>
                    <a href="login.html">退出</a>
                </div>
            </div>
            <div class="app">
                <div class="appWrap hvr-float-shadow">
                    <div class="imgwap" id="dvxxzx">
                        <span class="badge" style="position: absolute;right: 0;top: 5px; background-color:red"></span>
                        <i class="iconfont icon-xiaoxi"></i>
                    </div>
                    <a href="#">消息</a>
                </div>
            </div>
            <div class="app">
                <div class="appWrap hvr-float-shadow">
                    <div class="imgwap"><i class="iconfont icon-guanlizhongxin"></i></div>
                    <a href="javascript:;">基础应用</a>
                    <!--应用-->
                    <div class="appList animated fadeInUp">
                        <div class="bgt"></div>
                        <div class="bgm">
                            <div class="mask">
                                <div id="appSlider" style="margin-left: 0; width: 584px;">
                                    <div class="screen">
                                        <ul class="appmenu">
                                            <li codeurl="/View/APPBaseView/APP_QYGG.html" code="QYGG">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/企业公告-pc.png" class="indextb" />
                                                    <div>企业公告</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_TXL.html" code="TXL">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/通讯录-pc.png" class="indextb" />
                                                    <div>通讯录</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_GZRZ.html" code="GZRZ">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/工作日报-pc.png" class="indextb" />
                                                    <div>工作日报</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_KHGL.html" code="KHGL">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/客户管理-pc.png" class="indextb" />
                                                    <div>客户管理</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_RCTX.html" code="RCTX">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/任务代办-pc.png" class="indextb" />
                                                    <div>任务待办</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_JFBX.html" code="JFBX">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/经费报销-pc.png" class="indextb" />
                                                    <div>经费报销</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_HDBM.html" code="HDBM">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/活动报名-pc.png" class="indextb" />
                                                    <div>活动报名</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_LCSP.html" code="LCSP">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/流程审批-pc.png" class="indextb" />
                                                    <div>流程审批</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_CCXJ.html" code="CCXJ">
                                                <a class="imgwap" href="#"
                                                   style="display: block;">
                                                    <img src="/images/QJY/请假出差-pc.png" class="indextb" />
                                                    <div>出差请假</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_DXGL.html" code="DXGL">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/短信管理-pc.png" class="indextb" />
                                                    <div>短信管理</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/QYWD/APP_QYWD_GR.html" code="QYWD">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/doc-pc.png" class="indextb" />
                                                    <div>文档管理</div>
                                                </a>
                                            </li>
                                            <li class="xtsz" codeurl="/View/APPBaseView/APP_XTSZ.html" code="XTSZ">
                                                <a class="imgwap" href="Admin/indexAdmin.html" target="_blank" style="display: block;">
                                                    <img src="/images/QJY/icon06-pc.png" class="indextb" />
                                                    <div>系统设置</div>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div id="jinIndicators" class="indicators" style="display:none"><span class="active"></span><span></span></div>
                        </div>
                        <div class="bgb"></div>
                    </div>
                </div>
            </div>
            <div class="app">
                <div class="appWrap hvr-float-shadow">
                    <div class="imgwap">
                        <i class="iconfont icon-yingyongguanli"></i>
                    </div>
                    <a href="javascript:;">业务应用</a>
                    <!--应用-->
                    <div class="appList animated fadeInUp">
                        <div class="bgt"></div>
                        <div class="bgm">
                            <div class="mask">
                                <div class="appSlider" style="margin-left: 0; width: 584px;">
                                    <div class="screen">
                                        <ul class="appmenu">
                                            <li codeurl="/View/APPBaseView/APP_LSGL.html" code="LSGL">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/企业公告-pc.png" class="indextb" />
                                                    <div>老师管理</div>
                                                </a>
                                            </li>
                                            <li codeurl="/View/APPBaseView/APP_GYSGL.html" code="GYSGL">
                                                <a class="imgwap" href="#" style="display: block;">
                                                    <img src="/images/QJY/企业公告-pc.png" class="indextb" />
                                                    <div>代理商</div>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="indicators jinIndicators" style="display:none"><span class="active"></span><span></span></div>
                        </div>
                        <div class="bgb"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="tab_content">
        <div class="wrapper" style="width:85%">
            <ul class="tab_nav">
                <li hrefurl='/indexPage.html' appcode='indexPage' class="active" title="双击刷新">工作台</li>
            </ul>
            <div class="tab_content">
                <div class="tab_pane active" id="TabindexPage">
                    <iframe marginwidth="0" class="tabiframe" style="min-height:500px" marginheight="0" frameborder="0" scrolling="no" id="main" name="main" width="100%" src="indexPage.html"></iframe>
                </div>
            </div>
            <script type="text/javascript">
                SetFrameHeight('main')
            </script>
        </div>
    </div>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script>
        $(function () {
            $(".tab_nav li").live('click', function () {
                $(".tab_pane").hide();
                if ($("#Tab" + $(this).attr("appcode")).length === 0) {
                    openframe($(this).attr("hrefurl"), $(this).attr("appcode"));
                }
                $("#Tab" + $(this).attr("appcode")).show();
                $(".tab_nav li").removeClass("active");
                $(this).addClass("active");

            }).live("dblclick", function () {
                var framename = $("iframe:visible").attr('name');
                frames[framename].location.reload(true);
            })
            $(".appmenu li").click(function () {
                //如果已经存在该Tab，则转到该Tab
                if ($(this).attr("code") != "XTSZ") {
                    if ($("li[appcode='" + $(this).attr("code") + "']").length > 0) {
                        $("li[appcode='" + $(this).attr("code") + "']").trigger('click');
                    }
                    else {
                        addNewTab($(this).attr("codeurl"), $(this).attr("code"), $(this).text())
                        openframe($(this).attr("codeurl"), $(this).attr("code"))
                    }
                }
            })
            $(".jinIndicators").on("click", "span", function () {
                var i = $(this).index();
                $(this).addClass("active").siblings().removeClass("active");
                $(".appSlider").animate({ "marginLeft": "-" + 292 * i + "px" }, 200);
            });
            $(".appexit").click(function () {
                location.href = "login.html";
            })

            var code = ComFunJS.getCookie("codes") ? ComFunJS.getCookie("codes") : "GZRZ,RCTX,QYWD";
            if (code) {
                for (var i = 0; i < code.split(",").length; i++) {
                    if (code.split(",")[i] != "") {
                        var dom = $("li[code='" + code.split(",")[i] + "']");
                        addNewTab(dom.attr("codeurl"), dom.attr("code"), dom.text(), true);
                        $("li[appcode='" + code.split(",")[i] + "']").find('.unlock').removeClass("icon-jiesuo").addClass("icon-suo");
                    }

                }
            }



            $("#dvxxzx").click(function () {
                if ($("li[appcode='XXZX']").length > 0) {
                    $("li[appcode='XXZX']").trigger('click');
                }
                else {
                    addNewTab('/View/APPBaseView/APP_XXZX.html', 'XXZX', '消息中心')
                    openframe('/View/APPBaseView/APP_XXZX.html', 'XXZX')
                }
            })

        });
    </script>
</body>
</html>